package com.dongxing.concyrrency.chapter3;

/**
 * @author XavierDong
 **/
public class CreateThread3 {

    private int i;
    private static int counter;

    private byte[] bytes = new byte[0x400];

    /**
     * JVM will create a thread named "main"
     *
     * @param args
     */
    public static void main(String[] args) {
        // create jvm stack
        try {
            add(counter);
        } catch (Error e) {
            e.printStackTrace();
            System.out.println(counter);
        }
    }

    private static void add(int i) {
        ++counter;
        add(i++);
    }
}
